﻿using LF.Domain.Entities;
using LF.Shared.Dtos.Input;
using LF.Shared.Dtos.Out;

namespace LF.Application.Services
{
    public interface IUserService : IApplicationService
    {
        Result<UserSearchOut> Users(UserSearch search);
        /// <summary>
        /// 获取所有用户（无分页）
        /// </summary>
        /// <param name="key">搜索关键字</param>
        /// <param name="deptId">部门ID</param>
        /// <returns>所有用户列表</returns>
        Result<List<UserOut>> GetAllUsers(string? key = null, string? deptId = null);
        Result RealDelete(Guid id);
        Result Delete(Guid[] ids);
        Result<UserOut> Get(Guid id);
        Result Edit(UserOut user);
        Result<List<UserRoleOut>> GetRoles(Guid id);
        Result PostRoles(List<UserRoleOut> roles);

        Result<List<RoleMenuOut>> Menus();

        Result ResetPwd(Guid id);

        Result<UserOut> GetCurrent();
        Result Token(UserInut user);
        
        /// <summary>
        /// 修改用户密码（需验证旧密码）
        /// </summary>
        /// <param name="input">包含旧密码和新密码的输入对象</param>
        /// <returns>操作结果</returns>
        Result ChangePassword(ChangePasswordInut input);
        
        /// <summary>
        /// 保存用户签名
        /// </summary>
        /// <param name="input">包含签名MD5值的输入对象</param>
        /// <returns>操作结果</returns>
        Result SaveSignature(SignatureInput input);
        
        /// <summary>
        /// 删除用户签名
        /// </summary>
        /// <returns>操作结果</returns>
        Result RemoveSignature();
        
        /// <summary>
        /// 获取当前用户信息（提供给第三方登录调用）
        /// </summary>
        /// <returns>用户信息</returns>
        Result<UserOut> GetUserInfo();
    }
}

